<?php /* Smarty version Smarty-3.1.12, created on 2013-04-11 21:08:39
         compiled from "D:\wamp\www\acps_new\templates\cash\edit.tpl" */ ?>
<?php /*%%SmartyHeaderCode:14946513a74982708c9-03218597%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'b17097ff95962d34c7a1bf5273070503ef4006ea' => 
    array (
      0 => 'D:\\wamp\\www\\acps_new\\templates\\cash\\edit.tpl',
      1 => 1365016030,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '14946513a74982708c9-03218597',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_513a7498479381_56392709',
  'variables' => 
  array (
    'data' => 0,
    'user' => 0,
    'type' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_513a7498479381_56392709')) {function content_513a7498479381_56392709($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ($_smarty_tpl->tpl_vars['data']->value['pathToError'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<script type="text/javascript">
    
        
    function showSecondUser(type){
        var both = "<?php echo $_smarty_tpl->tpl_vars['data']->value['bothMovesOfCash'];?>
";
        if (type==both){
            $("#secondUser").show();
        } else {
            $("#secondUser").hide();
        }
    }
        
    $(document).ready(function() {
        $(".float").change(function() {
            makeFloat(".float");
        });
        $("#date").datepicker({ 
            dateFormat: "dd/mm/yy",
            firstDay: 1      
        });
    });
    
</script>
<h2 class="pageTitle">Edit entry into cash</h2>
<form class="adding" action="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=edit_entry&entry=<?php echo $_smarty_tpl->tpl_vars['data']->value['entry_data']['Id'];?>
" method="post" onsubmit="return checkAdd_entry(
                                                                    $('#date').val(), 
                                                                    $('#amount').val(),
                                                                    $('#description').val()
                                                                                   )">
    <table class="tableForm">
        <tr>
            <td>
                <label for="user">User<span class="red">*</span> </label>
            </td>
            <td>
                <select name="entry_data[user]" id="user" size="1">
                    <?php  $_smarty_tpl->tpl_vars['user'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['user']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['recipients']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['user']->key => $_smarty_tpl->tpl_vars['user']->value){
$_smarty_tpl->tpl_vars['user']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['user']->key;
?>
                        <option <?php if ($_smarty_tpl->tpl_vars['user']->value['users_id']==$_smarty_tpl->tpl_vars['data']->value['entry_data']['user']){?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['user']->value['users_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['user']->value['surname'];?>
, <?php echo $_smarty_tpl->tpl_vars['user']->value['name'];?>
</option>
                    <?php } ?>
                </select>
            </td>
        </tr>
        <tr>
            <td>
                <label for="date">Date <span class="red">*</span> </label>
            </td>
            <td>
                <input name="entry_data[date]" id="date" type="text" value="<?php echo $_smarty_tpl->tpl_vars['data']->value['entry_data']['date_formated'];?>
" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="amount">Amount<span class="red">*</span> </label>
            </td>
            <td>
                <input name="entry_data[amount]" id="amount" type="text" class="float" value=<?php echo $_smarty_tpl->tpl_vars['data']->value['entry_data']['amount'];?>
 />
            </td>
        </tr>
        <tr>
            <td>
                <label for="moveType">Type of move<span class="red">*</span> </label>
            </td>
            <td>
                <select name="entry_data[moveType]" id="moveType" size="1" onchange="showSecondUser(this.value)">
                    <?php  $_smarty_tpl->tpl_vars['type'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['type']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['cash_types']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['type']->key => $_smarty_tpl->tpl_vars['type']->value){
$_smarty_tpl->tpl_vars['type']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['type']->key;
?>
                        <option <?php if ($_smarty_tpl->tpl_vars['type']->value['Id']==$_smarty_tpl->tpl_vars['data']->value['entry_data']['type_of_move']){?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['type']->value['Id'];?>
"><?php echo $_smarty_tpl->tpl_vars['type']->value['TypPohybu'];?>
</option>
                    <?php } ?>
                </select>
            </td>
        </tr>
        <tr id="secondUser" style="<?php if ($_smarty_tpl->tpl_vars['data']->value['entry_data']['type_of_move']!=$_smarty_tpl->tpl_vars['data']->value['bothMovesOfCash']){?>display: none<?php }?>">
            <td>
                <label for="recipient">Recipient<span class="red"></span> </label>
            </td>
            <td>
                <select name="entry_data[recipient]" id="recipient" size="1">
                    <?php  $_smarty_tpl->tpl_vars['user'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['user']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['recipients']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['user']->key => $_smarty_tpl->tpl_vars['user']->value){
$_smarty_tpl->tpl_vars['user']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['user']->key;
?>
                        <option <?php if ($_smarty_tpl->tpl_vars['user']->value['users_id']==$_smarty_tpl->tpl_vars['data']->value['entry_data']['other']['user']){?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['user']->value['users_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['user']->value['surname'];?>
, <?php echo $_smarty_tpl->tpl_vars['user']->value['name'];?>
</option>
                    <?php } ?>
                </select>
            </td>
        </tr>
        <tr>
            <td>
                <label for="description">Description <span class="red">*</span></label>
            </td>
            <td>
                <textarea cols="30" rows="5" name="entry_data[description]" id="description"><?php echo $_smarty_tpl->tpl_vars['data']->value['entry_data']['description'];?>
</textarea>
            </td>
        </tr>
        <?php if ($_SESSION['user']['user_type_id']==@USER_TYPE_ADMIN){?>
        <tr>
            <td>
                <label for="s">S</label>
            </td>
            <td>
                <input <?php if ($_smarty_tpl->tpl_vars['data']->value['entry_data']['s']==1){?>checked="checked"<?php }?> name="entry_data[s]" id="s" type="checkbox" value="1" />
            </td>
        </tr>
        <?php }?>
        <tr class="submitRow">
            <td>
                <?php if ($_smarty_tpl->tpl_vars['data']->value['entry_data']['transfer_between']!=-1){?>
                    <input name="other_entry" value="<?php echo $_smarty_tpl->tpl_vars['data']->value['entry_data']['other']['Id'];?>
" type="hidden" />
                <?php }?>
                <input name="action" value="edit_entry" type="hidden" />
            </td>
            <td>
                <input type="submit" value="Edit entry" name="edit_entry" /> &nbsp; 
                <span class="red">* Required</span>
            </td>
            <td></td>
        </tr>
    </table>
</form><?php }} ?>